<template>
  <div class="about">
    <h3>我是关于页</h3>
  </div>

  <div class="container">
    <button @click="show = !show">切换{{ show }}</button>

    <transition name="slide1">
      <p v-if="show" class="box">滑动出现</p>
    </transition>
  </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue'

const show = ref(true)

</script>

<style scoped>
.box {
  width: 200px;
  height: 100px;
  background: #409eff;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px auto;
  transform: translate(-100%, 0);
}

.slide1-enter-from,
.slide1-leave-to {
  transform: translate(100%, 0);
  transform: rotate(180deg);
  opacity: 0;
}

.slide1-enter-active,
.slide1-leave-active {
  transition: all 0.5s ease;
}
</style>
